package com.woniuxy.receiver;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @Author: 曾令忠
 * @Description:
 * @Date: 2020/7/7 0007-上午 11:26
 */
@Component
public class DelayReceiver {
//    @RabbitListener(queues = "delayQueue")
    public void receive(Message message){
        System.out.println("延时队列收到消息："+ new String(message.getBody())+"->"+new Date());
    }
    @RabbitListener(queues = "dead_delay_Queue")
    public void receiveDelay(Message message){
        System.out.println("死信队列收到消息："+new String(message.getBody())+"->"+new Date());
    }
}
